#ifndef OPTION_H
#define OPTION_H

#include <QWidget>
#include <QScrollBar>
#include <QPropertyAnimation>
#include <QTableWidgetItem>
#include <QSettings>
#include <QFile>
#include <QDir>
#include "adress.h"
#include "keyboard.h"
#include "itinerary.h"

namespace Ui {
    class Option;
}

class Option : public QWidget
{
    Q_OBJECT

public:
    explicit Option(QString settings_filename = "settings.ini", QWidget *parent = 0);
    ~Option();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::Option *ui;
    QSettings * settings;
    QString settings_filename;
    units current_unit;
    Transport_Mode current_transport_mode;
    QString current_language;
    bool current_keyboard_type;
    type_keyboard  current_keyboard_layout;
    QString current_theme;

    void Save_Settings();
    void Load_List_Themes();

public slots:
    void Get_Settings();
    void Change_Theme(QString theme_name, QString style);
    void Change_Theme(QTableWidgetItem * item);
    void Change_Keyboard_Layout(bool checked);
    void Change_Tranport_Mode(bool checked);
    void Change_Virtual_Keyboard(bool checked);

signals:
    void Unit_Changed(units);
    void Language_Changed(QString);
    void Theme_Changed(QString);
    void Virtual_Keyboard_Changed(bool);
    void Keyboard_Layout_Changed(type_keyboard);
    void Transport_Mode_Changed(Transport_Mode);
};

#endif // OPTION_H
